<!doctype html>
<?php
function isOne($value)
{
	if($value == '1')
		return '(v)';
	else
		return '( )';
}
function isTwo($value)
{
	if($value == '2')
		return '(v)';
	else
		return '( )';
}
function isChecked($obj)
{
	if($obj == 'E')
		return '&nbsp;';
	if($obj->value == '1')
		return '(v)&nbsp;' . $obj->name . ($obj->attachment ? '&nbsp;<i class="attach">See attachment</i>' : '');
	else
		return '(&nbsp;)&nbsp;' . $obj->name . ($obj->attachment ? '&nbsp;<i class="attach">See attachment</i>' : '');
}
?>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title></title>

	<style type="text/css">
	td.remarks{
		border-right: solid 1px #000;
	}
	div.header{
		text-align: center;
	}
	body,.importir table td{
		font-family: Arial;
		font-size: 12px;
	}
	table td{
		font-size: 12px !important;
	}
	table.rk {
		border: solid 2px #000;
		
	}
	td.rk1,td.rk2{
		width: 400px;
		/*font-weight: bold;*/
	}
	td.vat{padding-left: 183px}
	td.total{padding-left: 205px;font-weight: bold;}
	h3.h-title{
		color: blue;
	}
	div.content{
		padding: 1em;
	}
	div.importir{
		margin-top: 1em;
	}
	p.footer-text{
		background: #000;
		color: #fff;
		padding: 2px;
	}
	.logo{
		display: block;
	}
	td.title{
		text-decoration: underline;
		font-weight: bold;

	}
	div.subject{
		font-weight: bold;
	}
	td.no_srt{
		/*text-decoration: underline;*/
	}
	div.references,div.dtype,div.prov-srv,div.scope,div.dog{
		border: solid 1px #000;
		padding: 2px;
		margin: 1em 0;
	}
	table.io_ceklist td{
		font-size: 80%;
	}
	i.attach{
		color: blue;
		font-weight: bold;
	}
	div.dog{

	}
	td.dogtitle{
		border-bottom: 1px solid #000;
		padding-bottom: 4px;
	}
	</style>
</head>
<body>
<img src="<?php echo FCPATH . 'assets/pdf/header.png'?>" width="500"/>	
<br><br>
<div class="header">
	<table align="center">

		<tr><td class="title" align="center"><h3>INSPECTION ORDER</h3></td></tr>
		<tr><td class="no_srt" align="center">No.&nbsp;<u><?php echo $ql->io_no?></u></td></tr>
	</table>
</div>
<div class="content">
	<div class="importir">
		<table width="100%">
			<tr>
				<td valign="top">
					<table>
						<tr><td valign="top">To</td><td valign="top">:&nbsp;<?php echo $ql->io_to?></td></tr>
						<tr><td valign="top">Address</td><td valign="top">:&nbsp;<?php echo $ql->io_address?></td></tr>
						<tr><td valign="top">Attn</td><td valign="top">:&nbsp;<?php echo $ql->io_attn?></td></tr>
						<tr><td valign="top">Tel No.</td><td valign="top">:&nbsp;<?php echo $ql->io_tel_no?></td></tr>
						<tr><td valign="top">Fax No.</td><td valign="top">:&nbsp;<?php echo $ql->io_fax_no?></td></tr>
						<tr><td valign="top">Email</td><td valign="top">:&nbsp;<?php echo $ql->io_email?></td></tr>	
					</table>
				</td>
				<td valign="top">
					<table>
						<tr><td valign="top">From</td><td valign="top">:&nbsp;<?php echo $ql->io_from_name?></td></tr>
						<tr><td valign="top">Attn</td><td valign="top">:&nbsp;<?php echo $ql->io_from_attn?></td></tr>
						<tr><td valign="top">Tel No.</td><td valign="top">:&nbsp;<?php echo $ql->io_from_tel?></td></tr>
						<tr><td valign="top">Fax No.</td><td valign="top">:&nbsp;<?php echo $ql->io_from_fax?></td></tr>
						<tr><td valign="top">Email</td><td valign="top">:&nbsp;<?php echo $ql->io_from_email?></td></tr>
						<tr><td valign="top">Date</td><td valign="top">:&nbsp;<?php echo date('F d, Y',strtotime($ql->io_from_date))?></td></tr>
					</table>
				</td>
			</tr>
		</table>
	</div>
	<br>
	<br>
	<div class="references">
		<b><i>References : </i></b> Invoice/ Packing List No. <?php echo $ql->no_packing_list?> as per attached.
	</div>
	<div class="dtype">
		<b><i>Document Type : </i></b><?php echo $ql->io_doc_type?>
	</div>
	<div class="prov-srv">
		<b><i>Please provide service as follow : </i></b><br>
		<?php echo isOne($ql->io_services)?>&nbsp;<span>Second Hand Goods Inspection</span>&nbsp;&nbsp;&nbsp;<?php echo isTwo($ql->io_services)?>&nbsp;<span>Testing</span>
	</div>
	<div class="scope">
		<b><i>Please provide service as follow : </i></b><br>
		<table class="io_ceklist">
		<?php $index = 0?>
		<?php while($index < $scope_of_work_count):?>
		<tr>
			<?php 
			
			$l = $scope_of_work[$index];
			$r = $scope_of_work[$index+1];
			?>
			<td width="50%"><?php echo isChecked($l) ?></td>
			<td width="50%"><?php echo isChecked($r) ?></td>
		</tr>
		<?php $index += 2 ?>
		<?php endwhile;?>
		</table>
	</div>
	<div class="dog">
		<table width="100%">
			<tr><td colspan="2" class="dogtitle"><b>Description Of Goods<i class="attach">&nbsp;See attachment</i></b></td></tr>
			<tr>
				<td valign="top" width="50%">
					<b>Importir</b><br>
					<table>
						<tr><td valign="top">Name</td><td valign="top">:&nbsp;<?php echo $ql->Importir?></td></tr>
						<tr><td valign="top">Address</td><td valign="top">:&nbsp;<?php echo $ql->Alamat_Importir?></td></tr>
						<tr><td valign="top">Tel No.</td><td valign="top">:&nbsp;<?php echo $ql->Telp_Importir?></td></tr>
						<tr><td valign="top">Fax No.</td><td valign="top">:&nbsp;<?php echo $ql->Fax_Importir?></td></tr>
					</table>
				</td>
				<td valign="top" width="50%">
					<b>Exportir</b><br>
					<table>
						<tr><td valign="top">Name</td><td valign="top">:&nbsp;<?php echo $ql->Eksportir?></td></tr>
						<tr><td valign="top">Address</td><td valign="top">:&nbsp;<?php echo $ql->Alamat_Eksportir?></td></tr>
						<tr><td valign="top">Tel No.</td><td valign="top">:&nbsp;<?php echo $ql->Telp_Eksportir?></td></tr>
						<tr><td valign="top">Fax No.</td><td valign="top">:&nbsp;<?php echo $ql->Fax_Eksportir?></td></tr>
					</table>
				</td>
			</tr>
		</table>
	</div>
	<div class="dog">
		<table width="100%">
			<tr><td colspan="2" class=""><b>Place Of Inspection</b></td></tr>
			<tr>
				<td valign="top" width="50%">
				
					<table>
						<tr><td valign="top">Place Of Inspection</td><td valign="top">:&nbsp;<?php echo $ql->Alamat_Pemeriksaan?></td></tr>
						<tr><td valign="top">Date Of Inspection</td><td valign="top">:&nbsp;<?php echo date('d/m/Y',strtotime($ql->Tanggal_Periksa))?></td></tr>
				
					</table>
				</td>
				<td valign="top" width="50%">
					<table>
						<tr><td valign="top">Contact Person</td><td valign="top">:&nbsp;<?php echo $ql->io_contact_name?></td></tr>
						<tr><td valign="top">Mobile</td><td valign="top">:&nbsp;<?php echo $ql->io_contact_mobile?></td></tr>
						<tr><td valign="top">Tel No.</td><td valign="top">:&nbsp;<?php echo $ql->io_contact_tel?></td></tr>
						<tr><td valign="top">Fax No.</td><td valign="top">:&nbsp;<?php echo $ql->io_contact_fax?></td></tr>
						<tr><td valign="top">Email</td><td valign="top">:&nbsp;<?php echo $ql->io_contact_email?></td></tr>
					</table>
				</td>
			</tr>
		</table>
	</div>
	<div >
		<table width="100%" style="border:solid 1px #000;border-collapse:collapse;" cellpadding="4">
			<tr>
				<td valign="top" width="50%" class="remarks">
					<b><i>Remarks :</i></b><br>
					<p><?php echo $ql->io_remarks?></p>
				</td>
				<td valign="top" width="50%">
					<b><i>Signature :</i></b>
					<br><br><br><br><br>
					( <?php echo $ql->io_signature_name?> )
					<br>
					Project Coordinator
				</td>
			</tr>
		</table>
	</div>
</div>
</body>
</html>
